import { onMounted,computed, ref, watch } from 'vue'
export default function useTestHook(){

    onMounted(()=>{

        console.log("页面挂载");
        
    })
    const counts = ref(0);
    const add = () => {
        counts.value++;
    }
    const countsFormat = computed(() => {

        return "总数："+counts.value
    })

    watch(counts,(newValue)=>{

        console.log("监听",newValue);
        

    })
    return{
        counts,add,countsFormat
    }
}
